<!DOCTYPE html><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<meta charset="utf-8">
<title>phpDocumentor » \ActiveRecord\SqliteAdapter</title>
<meta name="author" content="Mike van Riel">
<meta name="description" content="">
<link href="../css/template.css" rel="stylesheet" media="all">
<script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script><script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script><script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script><script src="../js/bootstrap.js" type="text/javascript"></script><script src="../js/template.js" type="text/javascript"></script><script src="../js/prettify/prettify.min.js" type="text/javascript"></script><link rel="shortcut icon" href="../img/favicon.ico">
<link rel="apple-touch-icon" href="../img/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png">
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner"><div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">phpDocumentor</a><div class="nav-collapse"><ul class="nav">
<li class="dropdown">
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
                                    API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
<li><a>Packages</a></li>
<li><a href="../packages/ActiveRecord.html"><i class="icon-folder-open"></i> ActiveRecord</a></li>
<li><a href="../packages/Default.html"><i class="icon-folder-open"></i> Default</a></li>
</ul>
</li>
<li class="dropdown" id="charts-menu">
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
                                    Charts <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="../graph_class.html"><i class="icon-list-alt"></i> Class hierarchy diagram</a></li></ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#reports" class="dropdown-toggle" data-toggle="dropdown">
                                    Reports <b class="caret"></b></a><ul class="dropdown-menu">
<li><a href="../errors.html"><i class="icon-remove-sign"></i> Errors 
                <span class="label label-info">310</span></a></li>
<li><a href="../markers.html"><i class="icon-map-marker"></i> Markers 
                <ul><li>todo 
                <span class="label label-info">5</span>
</li></ul></a></li>
<li><a href="../deprecated.html"><i class="icon-stop"></i> Deprecated elements 
                <span class="label label-info">3</span></a></li>
</ul>
</li>
</ul></div>
</div></div>
<div class="go_to_top"><a href="#___" style="color: inherit">Back to top  <i class="icon-upload icon-white"></i></a></div>
</div>
<div id="___" class="container">
<noscript><div class="alert alert-warning">
                            Javascript is disabled; several features are only available
                            if Javascript is enabled.
                        </div></noscript>
<div class="row">
<div class="span4">
<span class="btn-group visibility" data-toggle="buttons-checkbox"><button class="btn public active" title="Show public elements">Public</button><button class="btn protected" title="Show protected elements">Protected</button><button class="btn private" title="Show private elements">Private</button><button class="btn inherited active" title="Show inherited elements">Inherited</button></span><div class="btn-group view pull-right" data-toggle="buttons-radio">
<button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button><button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button>
</div>
<ul class="side-nav nav nav-list">
<li class="nav-header">
<i class="icon-custom icon-method"></i> Methods
                    <ul>
<li class="method public "><a href="#method_accepts_limit_and_order_for_update_and_delete" title="accepts_limit_and_order_for_update_and_delete :: Specifies whether or not adapter can use LIMIT/ORDER clauses with DELETE &amp; UPDATE operations"><span class="description">Specifies whether or not adapter can use LIMIT/ORDER clauses with DELETE &amp; UPDATE operations</span><pre>accepts_limit_and_order_for_update_and_delete()</pre></a></li>
<li class="method public inherited"><a href="#method_columns" title="columns :: Retrieves column meta data for the specified table."><span class="description">Retrieves column meta data for the specified table.</span><pre>columns()</pre></a></li>
<li class="method public inherited"><a href="#method_commit" title="commit :: Commits the current transaction."><span class="description">Commits the current transaction.</span><pre>commit()</pre></a></li>
<li class="method public "><a href="#method_create_column" title="create_column :: "><span class="description">create_column()
        </span><pre>create_column()</pre></a></li>
<li class="method public inherited"><a href="#method_date_to_string" title="date_to_string :: Return a date time formatted into the database's date format."><span class="description">Return a date time formatted into the database's date format.</span><pre>date_to_string()</pre></a></li>
<li class="method public inherited"><a href="#method_datetime_to_string" title="datetime_to_string :: Return a date time formatted into the database's datetime format."><span class="description">Return a date time formatted into the database's datetime format.</span><pre>datetime_to_string()</pre></a></li>
<li class="method public inherited"><a href="#method_escape" title="escape :: Escapes quotes in a string."><span class="description">Escapes quotes in a string.</span><pre>escape()</pre></a></li>
<li class="method public inherited"><a href="#method_get_sequence_name" title="get_sequence_name :: Return a default sequence name for the specified table."><span class="description">Return a default sequence name for the specified table.</span><pre>get_sequence_name()</pre></a></li>
<li class="method public inherited"><a href="#method_insert_id" title="insert_id :: Retrieve the insert id of the last model saved."><span class="description">Retrieve the insert id of the last model saved.</span><pre>insert_id()</pre></a></li>
<li class="method public inherited"><a href="#method_instance" title="instance :: Retrieve a database connection."><span class="description">Retrieve a database connection.</span><pre>instance()</pre></a></li>
<li class="method public "><a href="#method_limit" title="limit :: Adds a limit clause to the SQL query."><span class="description">Adds a limit clause to the SQL query.</span><pre>limit()</pre></a></li>
<li class="method public "><a href="#method_native_database_types" title="native_database_types :: "><span class="description">native_database_types()
        </span><pre>native_database_types()</pre></a></li>
<li class="method public inherited"><a href="#method_next_sequence_value" title="next_sequence_value :: Return SQL for getting the next value in a sequence."><span class="description">Return SQL for getting the next value in a sequence.</span><pre>next_sequence_value()</pre></a></li>
<li class="method public inherited"><a href="#method_parse_connection_url" title="parse_connection_url :: Use this for any adapters that can take connection info in the form below
to set the adapters connection info."><span class="description">Use this for any adapters that can take connection info in the form below
to set the adapters connection info.</span><pre>parse_connection_url()</pre></a></li>
<li class="method public inherited"><a href="#method_query" title="query :: Execute a raw SQL query on the database."><span class="description">Execute a raw SQL query on the database.</span><pre>query()</pre></a></li>
<li class="method public inherited"><a href="#method_query_and_fetch" title="query_and_fetch :: Execute a raw SQL query and fetch the results."><span class="description">Execute a raw SQL query and fetch the results.</span><pre>query_and_fetch()</pre></a></li>
<li class="method public inherited"><a href="#method_query_and_fetch_one" title="query_and_fetch_one :: Execute a query that returns maximum of one row with one field and return it."><span class="description">Execute a query that returns maximum of one row with one field and return it.</span><pre>query_and_fetch_one()</pre></a></li>
<li class="method public "><a href="#method_query_column_info" title="query_column_info :: Query for column meta info and return statement handle."><span class="description">Query for column meta info and return statement handle.</span><pre>query_column_info()</pre></a></li>
<li class="method public "><a href="#method_query_for_tables" title="query_for_tables :: Query for all tables in the current database."><span class="description">Query for all tables in the current database.</span><pre>query_for_tables()</pre></a></li>
<li class="method public inherited"><a href="#method_quote_name" title="quote_name :: Quote a name like table names and field names."><span class="description">Quote a name like table names and field names.</span><pre>quote_name()</pre></a></li>
<li class="method public inherited"><a href="#method_rollback" title="rollback :: Rollback a transaction."><span class="description">Rollback a transaction.</span><pre>rollback()</pre></a></li>
<li class="method public "><a href="#method_set_encoding" title="set_encoding :: Executes query to specify the character set for this connection."><span class="description">Executes query to specify the character set for this connection.</span><pre>set_encoding()</pre></a></li>
<li class="method public inherited"><a href="#method_string_to_datetime" title="string_to_datetime :: Converts a string representation of a datetime into a DateTime object."><span class="description">Converts a string representation of a datetime into a DateTime object.</span><pre>string_to_datetime()</pre></a></li>
<li class="method public inherited"><a href="#method_supports_sequences" title="supports_sequences :: Tells you if this adapter supports sequences or not."><span class="description">Tells you if this adapter supports sequences or not.</span><pre>supports_sequences()</pre></a></li>
<li class="method public inherited"><a href="#method_tables" title="tables :: Returns all tables for the current database."><span class="description">Returns all tables for the current database.</span><pre>tables()</pre></a></li>
<li class="method public inherited"><a href="#method_transaction" title="transaction :: Starts a transaction."><span class="description">Starts a transaction.</span><pre>transaction()</pre></a></li>
</ul>
</li>
<li class="nav-header protected">» Protected
                    <ul><li class="method protected "><a href="#method___construct" title="__construct :: Class Connection is a singleton."><span class="description">Class Connection is a singleton.</span><pre>__construct()</pre></a></li></ul>
</li>
<li class="nav-header private">» Private
                    <ul><li class="method private inherited"><a href="#method_load_adapter_class" title="load_adapter_class :: Loads the specified class for an adapter."><span class="description">Loads the specified class for an adapter.</span><pre>load_adapter_class()</pre></a></li></ul>
</li>
<li class="nav-header">
<i class="icon-custom icon-property"></i> Properties
                    <ul>
<li class="property public inherited"><a href="#property_DEFAULT_PORT" title="$DEFAULT_PORT :: Default port."><span class="description"></span><pre>$DEFAULT_PORT</pre></a></li>
<li class="property public inherited"><a href="#property_PDO_OPTIONS" title="$PDO_OPTIONS :: Default PDO options to set for each connection."><span class="description"></span><pre>$PDO_OPTIONS</pre></a></li>
<li class="property public inherited"><a href="#property_QUOTE_CHARACTER" title="$QUOTE_CHARACTER :: The quote character for stuff like column and field names."><span class="description"></span><pre>$QUOTE_CHARACTER</pre></a></li>
<li class="property public inherited"><a href="#property_connection" title="$connection :: The PDO connection object."><span class="description"></span><pre>$connection</pre></a></li>
<li class="property public inherited"><a href="#property_date_format" title="$date_format :: Database's date format"><span class="description"></span><pre>$date_format</pre></a></li>
<li class="property public "><a href="#property_datetime_format" title="$datetime_format :: Database's datetime format"><span class="description"></span><pre>$datetime_format</pre></a></li>
<li class="property public inherited"><a href="#property_last_query" title="$last_query :: The last query run."><span class="description"></span><pre>$last_query</pre></a></li>
<li class="property public inherited"><a href="#property_protocol" title="$protocol :: The name of the protocol that is used."><span class="description"></span><pre>$protocol</pre></a></li>
</ul>
</li>
<li class="nav-header private">» Private
                    <ul>
<li class="property private inherited"><a href="#property_logger" title="$logger :: Contains a Logger object that must impelement a log() method."><span class="description"></span><pre>$logger</pre></a></li>
<li class="property private inherited"><a href="#property_logging" title="$logging :: Switch for logging."><span class="description"></span><pre>$logging</pre></a></li>
</ul>
</li>
</ul>
</div>
<div class="span8">
<a id="\ActiveRecord\SqliteAdapter"></a><ul class="breadcrumb">
<li>
<a href="../index.html"><i class="icon-custom icon-class"></i></a><span class="divider">\</span>
</li>
<li><a href="../namespaces/ActiveRecord.html">ActiveRecord</a></li>
<li class="active">
<span class="divider">\</span><a href="../classes/ActiveRecord.SqliteAdapter.html">SqliteAdapter</a>
</li>
</ul>
<div class="element class">
<p class="short_description">Adapter for SQLite.</p>
<div class="details">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>package</th>
<td><a href="../packages/ActiveRecord.html">ActiveRecord</a></td>
</tr></table>
<h3>
<i class="icon-custom icon-method"></i> Methods</h3>
<a id="method_accepts_limit_and_order_for_update_and_delete"></a><div class="element clickable method public method_accepts_limit_and_order_for_update_and_delete" data-toggle="collapse" data-target=".method_accepts_limit_and_order_for_update_and_delete .collapse">
<h2>Specifies whether or not adapter can use LIMIT/ORDER clauses with DELETE &amp; UPDATE operations</h2>
<pre>accepts_limit_and_order_for_update_and_delete() </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="method_columns"></a><div class="element clickable method public method_columns" data-toggle="collapse" data-target=".method_columns .collapse">
<h2>Retrieves column meta data for the specified table.</h2>
<pre>columns(string $table) : array</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::columns()</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$table</h4>
<code>string</code><p>Name of a table</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>array</code>An array of {@link Column} objects.</div>
</div></div>
</div>
<a id="method_commit"></a><div class="element clickable method public method_commit" data-toggle="collapse" data-target=".method_commit .collapse">
<h2>Commits the current transaction.</h2>
<pre>commit() </pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::commit()</td>
</tr></table>
</div></div>
</div>
<a id="method_create_column"></a><div class="element clickable method public method_create_column" data-toggle="collapse" data-target=".method_create_column .collapse">
<h2>create_column()
        </h2>
<pre>create_column($column) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument"><h4>$column</h4></div>
</div></div>
</div>
<a id="method_date_to_string"></a><div class="element clickable method public method_date_to_string" data-toggle="collapse" data-target=".method_date_to_string .collapse">
<h2>Return a date time formatted into the database's date format.</h2>
<pre>date_to_string(<a href="../classes/ActiveRecord.DateTime.html">\ActiveRecord\DateTime</a> $datetime) : string</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::date_to_string()</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$datetime</h4>
<code><a href="../classes/ActiveRecord.DateTime.html">\ActiveRecord\DateTime</a></code><p>The DateTime object</p></div>
<h3>Returns</h3>
<div class="subelement response"><code>string</code></div>
</div></div>
</div>
<a id="method_datetime_to_string"></a><div class="element clickable method public method_datetime_to_string" data-toggle="collapse" data-target=".method_datetime_to_string .collapse">
<h2>Return a date time formatted into the database's datetime format.</h2>
<pre>datetime_to_string(<a href="../classes/ActiveRecord.DateTime.html">\ActiveRecord\DateTime</a> $datetime) : string</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::datetime_to_string()</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$datetime</h4>
<code><a href="../classes/ActiveRecord.DateTime.html">\ActiveRecord\DateTime</a></code><p>The DateTime object</p></div>
<h3>Returns</h3>
<div class="subelement response"><code>string</code></div>
</div></div>
</div>
<a id="method_escape"></a><div class="element clickable method public method_escape" data-toggle="collapse" data-target=".method_escape .collapse">
<h2>Escapes quotes in a string.</h2>
<pre>escape(string $string) : string</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::escape()</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$string</h4>
<code>string</code><p>The string to be quoted.</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>string</code>The string with any quotes in it properly escaped.</div>
</div></div>
</div>
<a id="method_get_sequence_name"></a><div class="element clickable method public method_get_sequence_name" data-toggle="collapse" data-target=".method_get_sequence_name .collapse">
<h2>Return a default sequence name for the specified table.</h2>
<pre>get_sequence_name(string $table, string $column_name) : string</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::get_sequence_name()</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$table</h4>
<code>string</code><p>Name of a table</p></div>
<div class="subelement argument">
<h4>$column_name</h4>
<code>string</code><p>Name of column sequence is for</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>string</code>sequence name or null if not supported.</div>
</div></div>
</div>
<a id="method_insert_id"></a><div class="element clickable method public method_insert_id" data-toggle="collapse" data-target=".method_insert_id .collapse">
<h2>Retrieve the insert id of the last model saved.</h2>
<pre>insert_id(string $sequence) : int</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::insert_id()</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$sequence</h4>
<code>string</code><p>Optional name of a sequence to use</p></div>
<h3>Returns</h3>
<div class="subelement response"><code>int</code></div>
</div></div>
</div>
<a id="method_instance"></a><div class="element clickable method public method_instance" data-toggle="collapse" data-target=".method_instance .collapse">
<h2>Retrieve a database connection.</h2>
<pre>instance(string $connection_string_or_connection_name) : <a href="../classes/ActiveRecord.Connection.html">\ActiveRecord\Connection</a></pre>
<div class="labels">
<span class="label">Inherited</span><span class="label">Static</span>
</div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered">
<tr>
<th>see</th>
<td><a href="">\ActiveRecord\parse_connection_url</a></td>
</tr>
<tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::instance()</td>
</tr>
</table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$connection_string_or_connection_name</h4>
<code>string</code><p>A database connection string (ex. mysql://user:pass@host[:port]/dbname)
  Everything after the protocol:// part is specific to the connection adapter.
  OR
  A connection name that is set in ActiveRecord\Config
  If null it will use the default connection specified by ActiveRecord\Config->set_default_connection</p>
</div>
<h3>Returns</h3>
<div class="subelement response"><code><a href="../classes/ActiveRecord.Connection.html">\ActiveRecord\Connection</a></code></div>
</div></div>
</div>
<a id="method_limit"></a><div class="element clickable method public method_limit" data-toggle="collapse" data-target=".method_limit .collapse">
<h2>Adds a limit clause to the SQL query.</h2>
<pre>limit(string $sql, int $offset, int $limit) : string</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$sql</h4>
<code>string</code><p>The SQL statement.</p></div>
<div class="subelement argument">
<h4>$offset</h4>
<code>int</code><p>Row offset to start at.</p></div>
<div class="subelement argument">
<h4>$limit</h4>
<code>int</code><p>Maximum number of rows to return.</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>string</code>The SQL query that will limit results to specified parameters</div>
</div></div>
</div>
<a id="method_native_database_types"></a><div class="element clickable method public method_native_database_types" data-toggle="collapse" data-target=".method_native_database_types .collapse">
<h2>native_database_types()
        </h2>
<pre>native_database_types() </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="method_next_sequence_value"></a><div class="element clickable method public method_next_sequence_value" data-toggle="collapse" data-target=".method_next_sequence_value .collapse">
<h2>Return SQL for getting the next value in a sequence.</h2>
<pre>next_sequence_value(string $sequence_name) : string</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::next_sequence_value()</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$sequence_name</h4>
<code>string</code><p>Name of the sequence</p></div>
<h3>Returns</h3>
<div class="subelement response"><code>string</code></div>
</div></div>
</div>
<a id="method_parse_connection_url"></a><div class="element clickable method public method_parse_connection_url" data-toggle="collapse" data-target=".method_parse_connection_url .collapse">
<h2>Use this for any adapters that can take connection info in the form below
to set the adapters connection info.</h2>
<pre>parse_connection_url(string $connection_url) : object</pre>
<div class="labels">
<span class="label">Inherited</span><span class="label">Static</span>
</div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><pre><code>protocol://username:password@host[:port]/dbname
protocol://urlencoded%20username:urlencoded%20password@host[:port]/dbname?decode=true
protocol://username:password@unix(/some/file/path)/dbname
</code></pre>

<p>Sqlite has a special syntax, as it does not need a database name or user authentication:</p>

<pre><code>sqlite://file.db
sqlite://../relative/path/to/file.db
sqlite://unix(/absolute/path/to/file.db)
sqlite://windows(c%2A/absolute/path/to/file.db)
</code></pre></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::parse_connection_url()</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$connection_url</h4>
<code>string</code><p>A connection URL</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>object</code>the parsed URL as an object.</div>
</div></div>
</div>
<a id="method_query"></a><div class="element clickable method public method_query" data-toggle="collapse" data-target=".method_query .collapse">
<h2>Execute a raw SQL query on the database.</h2>
<pre>query(string $sql, array $values) : mixed</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::query()</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$sql</h4>
<code>string</code><p>Raw SQL string to execute.</p></div>
<div class="subelement argument">
<h4>$values</h4>
<code>array</code><p>&$values Optional array of bind values</p>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>mixed</code>A result set object</div>
</div></div>
</div>
<a id="method_query_and_fetch"></a><div class="element clickable method public method_query_and_fetch" data-toggle="collapse" data-target=".method_query_and_fetch .collapse">
<h2>Execute a raw SQL query and fetch the results.</h2>
<pre>query_and_fetch(string $sql, \Closure $handler) </pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::query_and_fetch()</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$sql</h4>
<code>string</code><p>Raw SQL string to execute.</p></div>
<div class="subelement argument">
<h4>$handler</h4>
<code><a href="http://php.net/manual/en/class.closure.php">\Closure</a></code><p>Closure that will be passed the fetched results.</p></div>
</div></div>
</div>
<a id="method_query_and_fetch_one"></a><div class="element clickable method public method_query_and_fetch_one" data-toggle="collapse" data-target=".method_query_and_fetch_one .collapse">
<h2>Execute a query that returns maximum of one row with one field and return it.</h2>
<pre>query_and_fetch_one(string $sql, array $values) : string</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::query_and_fetch_one()</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$sql</h4>
<code>string</code><p>Raw SQL string to execute.</p></div>
<div class="subelement argument">
<h4>$values</h4>
<code>array</code><p>&$values Optional array of values to bind to the query.</p>
</div>
<h3>Returns</h3>
<div class="subelement response"><code>string</code></div>
</div></div>
</div>
<a id="method_query_column_info"></a><div class="element clickable method public method_query_column_info" data-toggle="collapse" data-target=".method_query_column_info .collapse">
<h2>Query for column meta info and return statement handle.</h2>
<pre>query_column_info(string $table) : \ActiveRecord\PDOStatement</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$table</h4>
<code>string</code><p>Name of a table</p></div>
<h3>Returns</h3>
<div class="subelement response"><code>\ActiveRecord\PDOStatement</code></div>
</div></div>
</div>
<a id="method_query_for_tables"></a><div class="element clickable method public method_query_for_tables" data-toggle="collapse" data-target=".method_query_for_tables .collapse">
<h2>Query for all tables in the current database.</h2>
<pre>query_for_tables() : \ActiveRecord\PDOStatement</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>The result must only
contain one column which has the name of the table.</p></div>
<h3>Returns</h3>
<div class="subelement response"><code>\ActiveRecord\PDOStatement</code></div>
</div></div>
</div>
<a id="method_quote_name"></a><div class="element clickable method public method_quote_name" data-toggle="collapse" data-target=".method_quote_name .collapse">
<h2>Quote a name like table names and field names.</h2>
<pre>quote_name(string $string) : string</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::quote_name()</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$string</h4>
<code>string</code><p>String to quote.</p></div>
<h3>Returns</h3>
<div class="subelement response"><code>string</code></div>
</div></div>
</div>
<a id="method_rollback"></a><div class="element clickable method public method_rollback" data-toggle="collapse" data-target=".method_rollback .collapse">
<h2>Rollback a transaction.</h2>
<pre>rollback() </pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::rollback()</td>
</tr></table>
</div></div>
</div>
<a id="method_set_encoding"></a><div class="element clickable method public method_set_encoding" data-toggle="collapse" data-target=".method_set_encoding .collapse">
<h2>Executes query to specify the character set for this connection.</h2>
<pre>set_encoding($charset) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument"><h4>$charset</h4></div>
</div></div>
</div>
<a id="method_string_to_datetime"></a><div class="element clickable method public method_string_to_datetime" data-toggle="collapse" data-target=".method_string_to_datetime .collapse">
<h2>Converts a string representation of a datetime into a DateTime object.</h2>
<pre>string_to_datetime(string $string) : <a href="../classes/ActiveRecord.DateTime.html">\ActiveRecord\DateTime</a></pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::string_to_datetime()</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$string</h4>
<code>string</code><p>A datetime in the form accepted by date_create()</p>
</div>
<h3>Returns</h3>
<div class="subelement response"><code><a href="../classes/ActiveRecord.DateTime.html">\ActiveRecord\DateTime</a></code></div>
</div></div>
</div>
<a id="method_supports_sequences"></a><div class="element clickable method public method_supports_sequences" data-toggle="collapse" data-target=".method_supports_sequences .collapse">
<h2>Tells you if this adapter supports sequences or not.</h2>
<pre>supports_sequences() : boolean</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::supports_sequences()</td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response"><code>boolean</code></div>
</div></div>
</div>
<a id="method_tables"></a><div class="element clickable method public method_tables" data-toggle="collapse" data-target=".method_tables .collapse">
<h2>Returns all tables for the current database.</h2>
<pre>tables() : array</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::tables()</td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response">
<code>array</code>Array containing table names.</div>
</div></div>
</div>
<a id="method_transaction"></a><div class="element clickable method public method_transaction" data-toggle="collapse" data-target=".method_transaction .collapse">
<h2>Starts a transaction.</h2>
<pre>transaction() </pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::transaction()</td>
</tr></table>
</div></div>
</div>
<a id="method___construct"></a><div class="element clickable method protected method___construct" data-toggle="collapse" data-target=".method___construct .collapse">
<h2>Class Connection is a singleton.</h2>
<pre>__construct(array $info) : <a href="../classes/ActiveRecord.Connection.html">\ActiveRecord\Connection</a></pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>Access it via instance().</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$info</h4>
<code>array</code><p>Array containing URL parts</p></div>
<h3>Returns</h3>
<div class="subelement response"><code><a href="../classes/ActiveRecord.Connection.html">\ActiveRecord\Connection</a></code></div>
</div></div>
</div>
<a id="method_load_adapter_class"></a><div class="element clickable method private method_load_adapter_class" data-toggle="collapse" data-target=".method_load_adapter_class .collapse">
<h2>Loads the specified class for an adapter.</h2>
<pre>load_adapter_class(string $adapter) : string</pre>
<div class="labels">
<span class="label">Inherited</span><span class="label">Static</span>
</div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::load_adapter_class()</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$adapter</h4>
<code>string</code><p>Name of the adapter.</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>string</code>The full name of the class including namespace.</div>
</div></div>
</div>
<h3>
<i class="icon-custom icon-property"></i> Properties</h3>
<a id="property_DEFAULT_PORT"> </a><div class="element clickable property public property_DEFAULT_PORT" data-toggle="collapse" data-target=".property_DEFAULT_PORT .collapse">
<h2></h2>
<pre>$DEFAULT_PORT : int</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::$$DEFAULT_PORT</td>
</tr></table>
</div></div>
</div>
<a id="property_PDO_OPTIONS"> </a><div class="element clickable property public property_PDO_OPTIONS" data-toggle="collapse" data-target=".property_PDO_OPTIONS .collapse">
<h2></h2>
<pre>$PDO_OPTIONS : array</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::$$PDO_OPTIONS</td>
</tr></table>
</div></div>
</div>
<a id="property_QUOTE_CHARACTER"> </a><div class="element clickable property public property_QUOTE_CHARACTER" data-toggle="collapse" data-target=".property_QUOTE_CHARACTER .collapse">
<h2></h2>
<pre>$QUOTE_CHARACTER : string</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::$$QUOTE_CHARACTER</td>
</tr></table>
</div></div>
</div>
<a id="property_connection"> </a><div class="element clickable property public property_connection" data-toggle="collapse" data-target=".property_connection .collapse">
<h2></h2>
<pre>$connection : mixed</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::$$connection</td>
</tr></table>
</div></div>
</div>
<a id="property_date_format"> </a><div class="element clickable property public property_date_format" data-toggle="collapse" data-target=".property_date_format .collapse">
<h2></h2>
<pre>$date_format : string</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::$$date_format</td>
</tr></table>
</div></div>
</div>
<a id="property_datetime_format"> </a><div class="element clickable property public property_datetime_format" data-toggle="collapse" data-target=".property_datetime_format .collapse">
<h2></h2>
<pre>$datetime_format : string</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="property_last_query"> </a><div class="element clickable property public property_last_query" data-toggle="collapse" data-target=".property_last_query .collapse">
<h2></h2>
<pre>$last_query : string</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::$$last_query</td>
</tr></table>
</div></div>
</div>
<a id="property_protocol"> </a><div class="element clickable property public property_protocol" data-toggle="collapse" data-target=".property_protocol .collapse">
<h2></h2>
<pre>$protocol : string</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::$$protocol</td>
</tr></table>
</div></div>
</div>
<a id="property_logger"> </a><div class="element clickable property private property_logger" data-toggle="collapse" data-target=".property_logger .collapse">
<h2></h2>
<pre>$logger : object</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::$$logger</td>
</tr></table>
</div></div>
</div>
<a id="property_logging"> </a><div class="element clickable property private property_logging" data-toggle="collapse" data-target=".property_logging .collapse">
<h2></h2>
<pre>$logging : bool</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\ActiveRecord\Connection::$$logging</td>
</tr></table>
</div></div>
</div>
</div>
</div>
</div>
</div>
<div class="row"><footer class="span12">
            Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
            Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a12</a> and<br>
            generated on 2013-06-08T13:56:19-04:30.<br></footer></div>
</div>
</body>
</html>
